This minor version has been deprecated
MuleSoft Accelerator for Salesforce B2C Commerce Cloud
Use case 2 - Inventory
Overview
The following use case is covered:
- Inventory (B2C Commerce Cloud ← SAP)
On a scheduled basis (which is configurable), this use case shows you how to build the inventory list and push it into B2C Commerce Cloud.
High-level architecture
Workflow
Here is how it works:
- A scheduled event (which is configurable) is triggered in the scheduling service that calls the inventory process API. See the Common Scheduler for more information.
- Through the SAP system API, the inventory process API queries the inventory list and checks if it was created or updated since the last run from SAP.
- For each of the returned inventory items, data is then sent into the production environment of Commerce Cloud.
Sequence diagram
Systems involved:
- ERP System: Contains information about inventory and specific plant locations. SAP is accessed via the ERP system API.
- B2C Commerce Cloud: Mule publishes inventory information into Commerce Cloud in the store inventory list.
Setup instructions
SAP Configuration
Follow the Custom BAPI setup instructions.
Mule projects
Follow the readme instructions of the following Mule application projects to set up and deploy the projects into Anypoint Platform for this use case.
Configurable Properties in the YAML file
Name | Value |
---|---|
jobs.** | properties for the “Jobs” object store. This OS stores the timestamp watermark for each unique job e.g. “products”, “inventory”. |
product | properties for the products job/schedule. |
inventory.** | properties for the inventory job/schedule. |
- SAP System API | API Specification | Implementation Template
Configurable Properties in the YAML file
Name | Value |
---|---|
sap.ivmaxrows | number of rows returned from the SAP BAPI function execution. |
sap.bapi | How inventory records are fetched from the specific BAPI function in SAP |
- Commerce Cloud System API | API Specification | Implementation Template
- Inventory Process API | API Specification | Implementation Template
Configurable Properties in the YAML file
Name | Value |
---|---|
config.batch | mode in which inventory requests are sent to Commerce Cloud. If set to “yes” then Mule sends inventory records in a batch and if set to “no” then Mule sends one inventory record per request into Commerce Cloud |
aggregator.size | number of inventory records that Mule should send to Commerce Cloud in a single request. Commerce Cloud constrains this to a maximum of 50. |
Sap-plant | map the sap plant Id’s from SAP to Inventory list configured in Commerce Cloud. |
inv-list | configure the reverse mapping of inventory list to SAP plant Id. |
Execution:
- Perform goods movement in SAP.
- Create new Inventory Lists in Commerce Cloud.
- Map the sap-plant to inv-list inside “Inventory Process API” properties.
- Run “Common Scheduler” inventory job.
- Schedules-> Inventory_process -> Run Now
- Check that the Commerce Cloud Inventory lists created in step 2 are filled with the new material stock.
B2C Commerce Cloud Components & configurations:
- Create the appropriate inventory list in Commerce Cloud where the inventory information should be sent.
- Batch
- InventoryLists resource
SAP Components & Configurations
BAPI exposing the inventory information
Data elements
Element Name | Data Type | Description |
---|---|---|
allocation | Decimal | The allocation quantity and reset date. |
ats | Decimal | The quantity of items available to sell (ATS). This is calculated as the allocation plus the preorderBackorderAllocation minus the turnover. |
creation_date | Date | Returns the value of attribute 'creationDate'. |
inventory_list_id | String | The user supplied ID of the inventory list. |
product_id | String | The user supplied ID of the product. |
product_name | String | The name of the product. |
stock_level | Decimal | The current stock level. This is calculated as the allocation minus the turnover. |